home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 15575 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.4 KB  |  52 lines

  1. Path: dispatch.news.demon.net!demon!uribe.demon.co.uk
  2. From: roger@uribe.demon.co.uk (Roger Uribe)
  3. Newsgroups: comp.lang.c++
  4. Subject: const FAR* for a DLL
  5. Date: Sun, 07 Apr 1996 10:32:44 GMT
  6. Message-ID: <828873144.24425@uribe.demon.co.uk>
  7. NNTP-Posting-Host: uribe.demon.co.uk
  8. X-NNTP-Posting-Host: uribe.demon.co.uk
  9. X-Newsreader: Forte Free Agent 1.0.82
  10.  
  11. Below is an exctract from a DLL I am trying to write. The 2nd parameter
  12. for FillRect is defined in windows.h as const RECT FAR*  Could somebody
  13. PLEASE tell me how to set it up - I've tried everything I can think of,
  14. plus a few suggestions from others with no success so far.
  15. e.g.   &rect  and other attempts to define a suitable pointer.
  16.  
  17. #include <windows.h>
  18. //This is copied from windows.h
  19. //int  WINAPI FillRect(HDC, const RECT FAR*, HBRUSH);  
  20.  
  21. int FAR PASCAL _export LibMain(HANDLE hInstance,WORD wDataSeg,
  22.     WORD wHeapSize,LPSTR lpszCmdLine)
  23. {
  24.     if(wHeapSize > 0)
  25.     UnlockData(0);
  26.     return(1);
  27. };
  28.  
  29. int FAR PASCAL _export myShow(int dest)
  30. {             
  31. int i;
  32. long colour;
  33. typedef struct
  34.  { int left;  int top;  int right;  int bottom;}
  35.  Srect;
  36.  
  37. Srect rect;
  38.  
  39.  colour = 0xFF00 ; 
  40.  i= FillRect( dest, rect, CreateSolidBrush (colour));   <--- here please
  41.  return(i);
  42. }                                            
  43.  
  44. c:\...\drect.c(22) : error C2115: 'argument' : incompatible types
  45. c:\...\drect.c(22) : warning C4024: 'FillRect' : different type
  46.                                      for formal and actual parameter 2
  47.  
  48. Thanks Roger
  49. ------- the end
  50.  
  51.  
  52.